//
//  ListenFMData.m
//  __PRODUCTNAME__
//
//  Created by li cheng on 16/09/02
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "ListenFMData.h"
#import "ListenFMHot_Fm.h"
#import "ListenFMNew_Lesson.h"
#import "ListenFMCategory.h"
#import "ListenFMNew_Fm.h"

@implementation ListenFMData

+ (NSDictionary *)objectClassInArray{
    return @{@"hot_fm" : [ListenFMHot_Fm class], @"myNew_lesson" : [ListenFMNew_Lesson class], @"category" : [ListenFMCategory class], @"myNew_fm" : [ListenFMNew_Fm class]};
}

- (void)setValue:(id)value forKey:(NSString *)key{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"hot_fm"]) {
        NSMutableArray<ListenFMHot_Fm *> *mArrayOfListenFMHot_Fm = [NSMutableArray array];
        for (NSDictionary *dic in _hot_fm) {
            ListenFMHot_Fm *listenFMHot_Fm = [ListenFMHot_Fm modelDic:dic];
            [mArrayOfListenFMHot_Fm addObject:listenFMHot_Fm];
        }
        _hot_fm = mArrayOfListenFMHot_Fm;
    }
    if ([key isEqualToString:@"category"]) {
        NSMutableArray<ListenFMCategory *> *mArrayOfListenFMCategory = [NSMutableArray array];
        for (NSDictionary *dic in _category) {
            ListenFMCategory *listenFMCategory = [ListenFMCategory modelDic:dic];
            [mArrayOfListenFMCategory addObject:listenFMCategory];
        }
        _category = mArrayOfListenFMCategory;
    }
}
- (void)setValue:(id)value forUndefinedKey:(nonnull NSString *)key{
    [super setValue:value forUndefinedKey:key];
    if ([key isEqualToString:@"new_lesson"]) {
        NSMutableArray<ListenFMNew_Lesson *> *mArrayOfListenFMNew_Lesson = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ListenFMNew_Lesson *listenFMNew_Lesson = [ListenFMNew_Lesson modelDic:dic];
            [mArrayOfListenFMNew_Lesson addObject:listenFMNew_Lesson];
        }
        _myNew_lesson = mArrayOfListenFMNew_Lesson;
    }
    if ([key isEqualToString:@"new_fm"]) {
        NSMutableArray<ListenFMNew_Fm *> *mArrayOfListenFMNew_Fm = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ListenFMNew_Fm *listenFMNew_Fm = [ListenFMNew_Fm modelDic:dic];
            [mArrayOfListenFMNew_Fm addObject:listenFMNew_Fm];
        }
        _myNew_fm = mArrayOfListenFMNew_Fm;
    }
}
@end
